.TH ctool 1
'''
.SH NAME
\fBctool\fR \- C toolchain and library manager
'''
.SH SYNOPSIS
.IP "\fBcd \fI/path/to/tooldir\fR" 4
Change to the toolchain directory before running following commands.
.IP "\fBctool\fR \fBuse\fR \fItool\fR" 4
Parse tool description to put some symlinks and/or scripts in ./bin
.IP "\fBctool\fR \fBuse\fR \fIpath/to/tool.desc\fR" 4
Same, with explicit path to the tool description.
.IP "\fBctool\fR \fBrepo\fR \fIpath/to/libs/\fR" 4
Use given path as the repository to look up library packages in.
.IP "\fBctool\fR \fBadd\fR \fIlibfoo\fR" 4
Deploy specified library package from the repository.
.IP "\fBctool\fR \fBadd\fR \fIpath/to/libs/libfoo.pac\fR" 4
Same, with explicit path to the package.
.IP "\fBctool\fR \fBdel\fR \fIlibfoo\fR" 4
Remove previously installed package.
.IP "\fBctool\fR \fBrebin\fR \fItool\fR" 4
Remove everything from ./bin, the run \fBuse\fR \fItool\fR.
'''
.SH DESCRIPTION
'''
This tool is a special purpose package manager for maintaining local
installation of libraries for C or C-like languages.
.P
Assuming a project needs a particular set of libraries, \fBctool\fR
should be used to unpack the libraries in a temporary location and set
up a compiler for the project that would see those libraries only,
regardless of what else is installed in the system and which libraries
other projects use.
'''
.SS Library packages
'''
\fBctool\fR works with pre-built, "binary" packages in \fBmpac\fR(1)
format. Typical contents for such a package would be just
.P
.nf
    inc/foo.h
    inc/foo/some.h
    inc/foo/other.h
    lib/libfoo.a
.fi
.P
The files get unpacked to the toolchain directory, and the compiler gets
instructed to look for headers in inc/ and for libraries in lib/.
'''
.SS Tool description files
'''
These are plain text files describing symlinks and scripts in toolchain's
bin directory.
.P
TODO: format description.
'''
.SS Toolchain directory
'''
The directory \fBctool\fR works on is assumed to be essentialy temporary.
While the compiler (installed elsewhere) and library packages (in the repo)
as seen as read-only external artifacts out of the scope of the project,
the scripts to run the compiler are a part of the project build setup and
the deployed library files are just working copies that can be deleted,
modified or replaced at will.
'''
.SH FILES
'''
.IP "\fB/base/etc/tool/\fIsome-cc\fR.desc\fR" 4
Tool description for \fBctool use \fIsome-cc\fR.
.IP "\fB/base/etc/mpac/\fIgz\fR" 4
Decoder for \fIgz\fR-compressed packages (\fIlibfoo.pac.gz\fR etc).
'''
.SH SEE ALSO
\fBmpac\fR(1).
